package com.itheima.zy;

public class Test16 {
    public static void main(String[] args) {
        int[] a = {154, 265, 248, 3699, 625, 541};
        for (int i = 0, b = a.length - 1; i < b; i++, b--) {
            int c = a[i];
            a[i] = a[b];
            a[b] = c;
        }
        int temp = 0;
        int max = a[0];
        int min = a[0];
        for (int i = 0; i < a.length; i++) {
            temp += a[i];
            System.out.println(a[i]);
            if (a[i] > max) {
                max = a[i];
            } else if (a[i] < min) {
                min = a[i];
            }
        }
        System.out.println("数值和:" + temp);
        System.out.println("最大值:" + max);
        System.out.println("最小值:" + min);
        System.out.println("平均值:" + temp / a.length);

    }
}
